<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="add()">add</button>
</body>
<script>
    let worker = new Worker('./3-1.js');
    worker.onmessage = function(val) {
        alert(val)
    }
    function add() {
        worker.postMessage('hello');
    }
</script>
</html>